﻿using FluentNHibernate.Mapping;
using SimpleScrum.Core.Entities;

namespace SimpleScrum.Core.Mappings
{
    public class ProjectMap : ClassMap<Project>
    {
        public ProjectMap()
        {
            Table("Project");
            LazyLoad();
            Id(x => x.Id).Column("ID").GeneratedBy.GuidComb();
            Map(x => x.Name).Column("Name").Not.Nullable();
            Map(x => x.Description).Column("Description").Not.Nullable();
            References(x => x.Organization).Column("OrganizationID").Cascade.All();
            Map(x => x.Status).Column("StatusID").Not.Nullable();
        }
    }
}